﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XDeal.BL.Interfaces;
using XDeal.DAL.Implements;
using XDeal.DAL.Entities;

namespace XDeal.BL.Implements
{
    public class DistrictBL: IDistrict
    {
        DistrictDAO districtDAO = new DistrictDAO();
        public DistrictBL() { }

        #region GET (Basic)
        /// <summary>
        /// Get All Deal
        /// </summary>
        /// <returns>List of Deals</returns>
        public List<District> GetAll()
        {
            return districtDAO.GetAll();
        }

        /// <summary>
        /// Get Deal by ID
        /// </summary>
        /// <param name="ID">Deal ID</param>
        /// <returns>One Deal</returns>
        public District GetByID(int ID)
        {
            return districtDAO.GetByID(ID);
        }
        #endregion

        #region GET ADVANCE

        public List<District> GetAllDistrictByProvinceID(int provinceID)
        {
            return districtDAO.GetAllDistrictByProviceID(provinceID);
        }

        #endregion

        #region Insert, Update, Delete
        /// <summary>
        /// Insert District
        /// </summary>
        /// <param name="ob">District Object</param>
        /// <returns>True: Successful | False: Fail</returns>
        public bool Insert(District bo)
        {
            return districtDAO.Insert(bo);
        }

        /// <summary>
        /// Update District by Object
        /// </summary>
        /// <param name="ob">District Object</param>
        /// <returns>True: Successful | False: Fail</returns>
        public bool Update(District bo)
        {
            return districtDAO.Update(bo);
        }

        /// <summary>
        /// Delete District by Object
        /// </summary>
        /// <param name="ob">District Object</param>
        /// <returns>True: Successful | False: Fail</returns>
        public bool Delete(District bo)
        {
            return districtDAO.Delete(bo);
        }

        /// <summary>
        /// Delete By ID
        /// </summary>
        /// <param name="ID">District ID</param>
        /// <returns>True: Successful | False: Fail</returns>
        public bool Delete(int ID)
        {
            return districtDAO.Delete(ID);
        }
        #endregion
    }
}
